//
//  RenGouOrderCell.m
//  LuCaiZhu
//
//  Created by stella Ma on 2018/12/20.
//
#import "UIColor+NN.h"
#import "Header.h"
#import "RenGouOrderCell.h"

@implementation RenGouOrderCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setOrderMode:(BookOrderMode *)orderMode {
    _name.text = orderMode.ProductName;
    _abcMode.text = orderMode.BookingType;
    _money.text = orderMode.Amount;
    _addMoney.text = orderMode.BookingFee;
    _orderStatus.text = orderMode.BookingStatus;
    _date.text = [NSString stringWithFormat:@"开放/成立日：%@",orderMode.PurchaseOpenDay];
    if ([orderMode.IsButton isEqualToString:@"0"]) {
        //可以操作
        self.leftLa.textColor = MAIN_COLOR_Red;
        self.rightLa.textColor = MAIN_COLOR_Red;
        self.leftPic.image = [UIImage imageNamed:@"bianji"];
        self.rightPic.image = [UIImage imageNamed:@"del"];
        self.editButton.enabled = YES;
        self.invalidBt.enabled = YES;
        
    }else{
       
        //不可操作
        self.leftLa.textColor = [UIColor colorWithHexString:@"c1c1c1"];
        self.rightLa.textColor = [UIColor colorWithHexString:@"c1c1c1"];
        self.leftPic.image = [UIImage imageNamed:@"bianji2"];
        self.rightPic.image = [UIImage imageNamed:@"del2"];
        self.editButton.enabled = NO;
        self.invalidBt.enabled = NO;
        
    }
    if ([orderMode.BookingStatus isEqualToString:@"作废"]) {
        self.name.textColor = _orderStatus.textColor = _abcMode.textColor = _addMoney.textColor = [UIColor colorWithHexString:@"c1c1c1"];
        self.money.textColor = [UIColor colorWithHexString:@"c1c1c1"];
        _label1.textColor = _label2.textColor = _label3.textColor = _label4.textColor = _date.textColor = [UIColor colorWithHexString:@"c1c1c1"];
        self.bottomHeight.constant = 0;
        _bottomView.hidden = YES;
    }else{
        self.name.textColor = _orderStatus.textColor = _abcMode.textColor = _addMoney.textColor = [UIColor blackColor];
        self.money.textColor = MAIN_COLOR_Red;
        
        _label1.textColor = _label2.textColor = _label3.textColor = _label4.textColor= _date.textColor = [UIColor colorWithHexString:@"676869"];
        self.bottomHeight.constant = 44;
        _bottomView.hidden = NO;
    }
    //已经是作废状态的作废按钮怎么处理，编辑和新建时的数字格式到底是什么样的
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}





@end
